<template>
  <h2>我是首页{{ VITE_APP_API_URL }}</h2>
  <h2>{{ store.state.user.name }}</h2>
  <el-button  type="success">我是 ElButton</el-button>
  <ChildComp :msg="msg" @childEvent="handleChildEvent"></ChildComp>
</template>



<script setup>
import { ref, reactive } from "vue"
import ChildComp from '@com/HelloWorld.vue'
import { useStore } from 'vuex' // 引入useStore 方法
const store = useStore()  // 该方法用于返回store 实例
console.log(store) 
console.log(store.state)  // store 实例对象
const VITE_APP_API_URL = ref(import.meta.env.VITE_APP_API_URL);

const msg = ref('');
msg.value = '哎，这就很棒！';

const state = reactive({
  name: 'vue3',
  age: '2020年9月18日'
})

// 点击事件
const handleChildEvent = (data) => {
  console.log('点击了',data)
}

</script>